-- 获取票的id和用户的id
local ticketId = ARGV[1]
local relativeId = ARGV[2]
local childrenId = ARGV[3]

-- 拼接键
local ticketKey = "action:ticket:" .. ticketId
local orderRelativeKey = "action:order:relative:" .. ticketId
local orderChildrenKey = "action:order:children:" .. ticketId

-- 库存恢复（无条件增加）
redis.call("INCRBY", ticketKey, 1)

-- 从下单集合中移除用户
redis.call("SREM", orderRelativeKey, relativeId)
redis.call("SREM", orderChildrenKey, childrenId)

-- 返回成功标志
return 1